﻿<%@ Page Language="C#" MasterPageFile="~/U_masterP.master" AutoEventWireup="true"
    CodeFile="conversation.aspx.cs" Inherits="conversation" %>

<%@ Register Src="uc_main/sideBar_right.ascx" TagName="sideBar_right" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>Conversation</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <style>
        .anchu
        {
        	text-indent=-99999px;
        }
    </style>
    <div id="content_top">
        <%--<div class="ngayCM"><p class="ngaycm2"><%# Eval("ngayTao","{0:dd/MM/yyyy}") %></p></div>--%>
        <div id="kep">
            <a>Liên lạc với người bán</a></div>
        <div id="tags">
            <p class="title_p">
            </p>
        </div>
    </div>
    <div class="clear">
    </div>
    <div id="sub_content">
        <div id="content_left">
            <!-- noi dung chinh -->
            <%-- <asp:UpdatePanel ID="updateMes" runat="server">e
                <ContentTemplate>--%>
            <div class="back" style="padding-top: 5px; padding-left: 5px;">
                <a style="color: #197DF1; float: left; margin-left: 5px; text-decoration: underline;
                    font-size: 11px; font-weight: bold;" href='#' onclick="return back()" title="Quay về trang trước">
                    Quay lại trang trước</a> <a style="color: #197DF1; float: right; margin-right: 5px;
                        text-decoration: underline; font-size: 11px; font-weight: bold;" href='<%= ResolveClientUrl("inboxlist.aspx") %>'
                        title="Quay về trang Inbox">Quay về trang Inbox</a>
            </div>
            <div class="clear">
                <asp:Label ID="Label1" runat="server" Visible="false" CssClass="anchu"></asp:Label>
            </div>
            <div class="controls">
                <div class="sub_controls">
                    <h3>
                        Conversation with <span class="nguoin"><a href="#">
                            <asp:Label ID="lblNB" runat="server"></asp:Label></a></span></h3>
                    <%--<div class="ngayCM"><p class="ngaycm2"><%# Eval("ngayTao","{0:dd/MM/yyyy}") %></p></div>--%>
                </div>
            </div>
            <!-- End Control -->
            <!-- Start Consersation -->
            <div class="conversation">
                <asp:DataList ID="DataList1" runat="server" OnItemDataBound="DataList1_ItemDataBound">
                    <ItemTemplate>
                        <!-- Noi dung  chat-->
                        <div class="message">
                            <div class="wrap_mess">
                                <div class="mes_left">
                                    <div class="mes_left_1">
                                        <a>
                                            <img src="avatar/ava<%# Eval("idNguoiGui") %>.jpg" id="_imgNG" width="31px" height="31px" /></a>
                                    </div>
                                    <div class="mes_left_2">
                                    </div>
                                </div>
                                <div class="mess_right">
                                    <div class="noidung_mess">
                                        <%--<div class="ngayCM"><p class="ngaycm2"><%# Eval("ngayTao","{0:dd/MM/yyyy}") %></p></div>--%>
                                        <div class="noidung_mess_con">
                                            <p>
                                                <%# Eval("NoiDungCM") %></p>
                                            <span class="dangboi"><a href='documents/<%# Eval("urlFile") %>' title="Nhấn để download file">
                                                <%# Eval("urlFile") %></a></span>
                                        </div>
                                        <div class="spam">
                                            <asp:LinkButton ID="linksaipham" OnCommand="linksaipham_Command" CommandArgument='<%# Eval("idMessDetails") %>'
                                                runat="server" Visible='<%#Eval("ViPham").ToString().ToLower().Equals("true")?false:true %>'
                                                OnClientClick='if (!confirm("Tin nhắn này làm phiển bạn ?")) return false;'>báo cáo sai phạm</asp:LinkButton></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- END -->
                    </ItemTemplate>
                </asp:DataList>
                <!-- Nhap noi dung mess -->
                <div class="type_mes" id="khungcm" runat="server">
                    <div class="message2">
                        <div class="wrap_mess">
                            <div class="mes_left">
                                <div class="mes_left_1">
                                    <a>
                                        <img id="currA" runat="server" /></a>
                                    <%--<a><img src="img/.jpg" width="31" height="31"/></a>--%>
                                </div>
                                <div class="mes_left_2">
                                </div>
                            </div>
                            <div class="mess_right">
                                <div class="noidung_mess">
                                    <div class="noidung_mess_con">
                                        <p>
                                            <h3>
                                                Gửi 1 tin nhắn đến <span id="ten">
                                                    <asp:Label ID="lblNguoiNhan" runat="server"></asp:Label></span></h3>
                                            <p>
                                            </p>
                                            <asp:TextBox ID="txt_mess" runat="server" CssClass="txt_mes" MaxLength="300" Rows="3"
                                                TextMode="MultiLine" Width="99%"></asp:TextBox>
                                            <div style="margin: 5px; cursor: pointer">
                                                <span class="attach"><a>Attach a file</a></span>
                                                <div class="send_">
                                                    <asp:Button ID="btn_SendMess" runat="server" CssClass="button_V" OnClientClick="return check()"
                                                        Text="Gửi" OnClick="btn_SendMess_Click" />
                                                </div>
                                                <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                                                <div class="upfile">
                                                    <asp:FileUpload ID="FileUpload1" runat="server" />
                                                   <%-- <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Chỉ chấp nhận file .rar , .zip "
                                                        ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.rar|.zip)$"
                                                        ControlToValidate="FileUpload1"></asp:RegularExpressionValidator>--%>
                                                    <p>
                                                        <span class="chuthich">(*) File kiểu .rar hoặc .zip. Kích thước không quá 20 MB.</span></p>
                                                </div>
                                            </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="disabledMes" id="khungerr" runat="server" style="display: none">
                    <p>
                        Không thể liên lạc tiếp tục liên lạc - bị chặn bởi người dùng .</p>
                    <p>
                        Bạn có thể
                        <asp:LinkButton ID="link_unspam" runat="server" OnCommand="link_unspam_Click"> click vào đây</asp:LinkButton>
                        để có thể tiếp tục liên lạc với người này.</p>
                </div>
                <%--</ContentTemplate>
            </asp:UpdatePanel>--%>
                <!-- END Nhap noi dung mess -->
                <%--<div class="phantrang" style="height:35px;margin-top:10px">
                    <cc1:CollectionPager ID="CollectionPager1" runat="server" PageSize="5" 
                        LabelText="Trang thứ : &amp;nbsp;" MaxPages="3" ResultsLocation="None" 
                        BackText="" NextText="" QueryStringKey="p"></cc1:CollectionPager>
                </div>--%>
            </div>
            <asp:Literal ID="Literal2" runat="server"></asp:Literal>
            <!-- ket  thuc noi dung -->
        </div>
        <div id="content_right">
            <uc1:sideBar_right ID="sideBar_right1" runat="server" />
        </div>
    </div>
    <script type="text/javascript">
        $(function () {
            $(".upfile").hide();
            $(".attach").click(function () {
                $(".upfile").toggle();
            });
            $(".mes_left_1 img").each(function () {
                $(this).error(function () {
                    $(this).attr('src', 'avatar/noavatar.jpg');

                });
            });
        });
        function check() {
            if ($(".txt_mes").val() == "") {
                alert("Message không được rỗng hoặc ít hơn 20 ký tự");
                $(".txt_mes").focus();
                return false;
            } else if ($(".txt_mes").val().length < 6) {
                alert("Tin nhắn ít nhất 7 ký tự !");
                $(".txt_mes").focus();
                return false;
            }
        }
        function back() {
            history.back();
            return false;
        }
    </script>
</asp:Content>
